{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 项目代码\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<Element 'div' class=('search-conditions',) data-selector='search-conditions'>]\n",
      "<Element 'div' class=('search-conditions',) data-selector='search-conditions'>\n",
      "[<Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>, <Element 'dt' class=('search-title',)>]\n",
      "公司：\n",
      "行业：\n",
      "城市：\n",
      "薪资：\n",
      "更多：\n",
      "<Element 'dd' class=('comp-list',)>\n",
      "<Element 'dd' class=('short-dd', 'select-industry') data-param='industries'>\n",
      "<Element 'dd' data-param='city'>\n",
      "<Element 'dd' data-param='salary'>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-time')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-jobkind')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compscale')>\n",
      "<Element 'dd' class=('dropdown', 'dropdown-compkind')>\n"
     ]
    }
   ],
   "source": [
    "# 对网页分类栏的文本类型抓取\n",
    "import pandas as pd\n",
    "from requests_html import HTMLSession\n",
    "\n",
    "url = \"https://www.liepin.com/zhaopin/?keyword=产品经理\"\n",
    "session = HTMLSession()\n",
    "r = session.get( url )\n",
    "\n",
    "主要元素 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')\n",
    "\n",
    "print (主要元素)\n",
    "print (主要元素[0])\n",
    "print (主要元素[0].xpath('//dt[@class=\"search-title\"]'))\n",
    "\n",
    "list_search_title = 主要元素[0].xpath('//dt[@class=\"search-title\"]')\n",
    "for x in list_search_title:\n",
    "    print (x.text)\n",
    "    \n",
    "list_search_dd = 主要元素[0].xpath('//dt[@class=\"search-title\"]/following-sibling::dd')\n",
    "for x in list_search_dd:\n",
    "    print (x)  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 公司\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'中国500强': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=155&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '2018互联网300强': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=182&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '制造业500强': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=186&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " 'AI创新成长50强 ': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=189&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '独角兽': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=130&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '上市公司': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&compTag=156&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c'}"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对城市的数据（链接、文本）抓取\n",
    "公司数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[0] \\\n",
    "                    .xpath('//div[contains(@class,\"hot-comp-tags\")]/a')\n",
    "公司数据选择器链结\n",
    "\n",
    "公司数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 公司数据选择器链结}\n",
    "公司数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 6 entries, 0 to 5\n",
      "Data columns (total 6 columns):\n",
      "scheme      6 non-null object\n",
      "netloc      6 non-null object\n",
      "path        6 non-null object\n",
      "params      6 non-null object\n",
      "query       6 non-null object\n",
      "fragment    6 non-null object\n",
      "dtypes: object(6)\n",
      "memory usage: 416.0+ bytes\n",
      "scheme      1\n",
      "netloc      1\n",
      "path        1\n",
      "params      1\n",
      "query       6\n",
      "fragment    1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "1                /zhaopin/          \n",
       "2                /zhaopin/          \n",
       "3                /zhaopin/          \n",
       "4                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "1  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "2  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "3  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "4  init=-1&headckid=3126235f410baf6a&flushckid=1&...           "
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对于城市爬取出来的url，使用urllib3 解析 url\n",
    "\n",
    "from urllib.parse import urlparse, parse_qs # 详细看上面urllib模块的介绍。\n",
    "df = pd.DataFrame([ urlparse(x) for x in 公司数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique()) # 用nunique这个函数可以查看数据有多少个不同值。\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init             1\n",
      "headckid         1\n",
      "flushckid        1\n",
      "fromSearchBtn    1\n",
      "keyword          1\n",
      "compTag          6\n",
      "ckid             1\n",
      "siTag            1\n",
      "d_sfrom          1\n",
      "d_ckId           1\n",
      "d_curPage        1\n",
      "d_pageSize       1\n",
      "d_headId         1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>init</th>\n",
       "      <th>headckid</th>\n",
       "      <th>flushckid</th>\n",
       "      <th>fromSearchBtn</th>\n",
       "      <th>keyword</th>\n",
       "      <th>compTag</th>\n",
       "      <th>ckid</th>\n",
       "      <th>siTag</th>\n",
       "      <th>d_sfrom</th>\n",
       "      <th>d_ckId</th>\n",
       "      <th>d_curPage</th>\n",
       "      <th>d_pageSize</th>\n",
       "      <th>d_headId</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>155</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>182</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>186</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>189</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>130</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  init          headckid flushckid fromSearchBtn keyword compTag  \\\n",
       "0   -1  3126235f410baf6a         1             2    产品经理     155   \n",
       "1   -1  3126235f410baf6a         1             2    产品经理     182   \n",
       "2   -1  3126235f410baf6a         1             2    产品经理     186   \n",
       "3   -1  3126235f410baf6a         1             2    产品经理     189   \n",
       "4   -1  3126235f410baf6a         1             2    产品经理     130   \n",
       "\n",
       "               ckid                                          siTag  \\\n",
       "0  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "1  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "2  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "3  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "4  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "\n",
       "          d_sfrom                            d_ckId d_curPage d_pageSize  \\\n",
       "0  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "1  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "2  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "3  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "4  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "\n",
       "                           d_headId  \n",
       "0  7377985f13f671459f1bac5712675d4c  \n",
       "1  7377985f13f671459f1bac5712675d4c  \n",
       "2  7377985f13f671459f1bac5712675d4c  \n",
       "3  7377985f13f671459f1bac5712675d4c  \n",
       "4  7377985f13f671459f1bac5712675d4c  "
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 通过url的解析，看出了在url中只有query值不同，因此我们做下一步针对query 再解析\n",
    "\n",
    "#df_qs = pd.DataFrame([ parse_qs(x) for x in df['query'] ])\n",
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head()\n",
    "#df_qs[['keyword','compTag']] 抓取表格中的某个值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['155'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}\n",
      "{'中国500强': '155', '2018互联网300强': '182', '制造业500强': '186', 'AI创新成长50强 ': '189', '独角兽': '130', '上市公司': '156'}\n"
     ]
    }
   ],
   "source": [
    "# 建构城市的参数模板 及 字典_compTag\n",
    "def parse_url_qs_for_compTag (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "#1.输出第一条解析的url\n",
    "# parse_url_qs_for_compTag(list(公司数据选择器链结.values())[0])['compTag']\n",
    "参数模板 = parse_url_qs_for_compTag(list(公司数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "\n",
    "# 2.选取表格中的comptag的值\n",
    "[ parse_url_qs_for_compTag(x)['compTag'] for x in 公司数据选择器链结.values()]\n",
    "#[ parse_url_qs_for_compTag(x)['compTag'][0] for x in 公司数据选择器链结.values()]\n",
    "\n",
    "# 3.加上文本说明后的字典\n",
    "字典_compTag = { k:parse_url_qs_for_compTag(v)['compTag'][0] for k,v in 公司数据选择器链结.items()}\n",
    "print (字典_compTag)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'中国500强': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['155'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '2018互联网300强': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['182'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '制造业500强': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['186'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, 'AI创新成长50强 ': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['189'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '独角兽': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['130'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '上市公司': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'compTag': ['156'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}}\n"
     ]
    }
   ],
   "source": [
    "# 生成城市参数模板  \n",
    "def 参数模板生成(compTag , keyword ):\n",
    "    参数 = 参数模板.copy()  # 复制一份参数模版\n",
    "    参数['compTag'] = compTag\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "# 赋值：keyword\n",
    "参数_compTag_产品经理 = { k:参数模板生成(compTag = [v], keyword = ['产品经理']) for k,v in 字典_compTag.items()}\n",
    "print(参数_compTag_产品经理)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "# request请求\n",
    "session = HTMLSession()\n",
    "\n",
    "def requests_liepin( url, params):\n",
    "    r = session.get( url , params = payload)\n",
    "\n",
    "    # 先取特定元素, 精准打击其子后辈\n",
    "    主要元素 = r.html.xpath( '//ul[@class=\"sojob-list\"]/li')\n",
    "\n",
    "    # 作为xpath字典，键为我要抓的牛肉名称，值为xpath\n",
    "    dict_xpaths={ \n",
    "        'text': {\n",
    "            '教育水平':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]',\n",
    "            '经验':      '//div[contains(@class,\"job-info\")]/p/span[@class=\"edu\"]/following-sibling::span',\n",
    "            '薪水':    '//div[contains(@class,\"job-info\")]/p/span[@class=\"text-warning\"]', \n",
    "            '时间':    '//div[contains(@class,\"job-info\")]/p/time/@title', \n",
    "            '职称':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司地点': '//div[contains(@class,\"job-info\")]/p/a',\n",
    "            '公司名称': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a',  \n",
    "        },\n",
    "        'text_content': {\n",
    "        },\n",
    "        'href': {\n",
    "            '链结':    '//div[contains(@class,\"job-info\")]/h3/a', \n",
    "            '公司URL': '//div[contains(@class,\"sojob-item-main\")]//p[@class=\"company-name\"]/a', \n",
    "        }\n",
    "    }\n",
    "\n",
    "    def get_e_text_content(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [e.xpath(_xpath_)[0].lxml.text_content() for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_text(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [\"\".join([x.strip() if type(x) is str else x.text.strip() for x in e.xpath(_xpath_)]) for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    def get_e_href(_xpath_):\n",
    "        # 高级列表推导\n",
    "        暂存结果 = [list(e.xpath(_xpath_, first=True).absolute_links)[0] \\\n",
    "                   if len(e.xpath(_xpath_, first=True).absolute_links) >= 1  \\\n",
    "                   else \"\" for e in 主要元素]\n",
    "        return(暂存结果)\n",
    "\n",
    "    # 只对主要元素下进行.xpath取值\n",
    "    数据字典 = dict()\n",
    "\n",
    "    数据字典 = {k:get_e_text_content(v) for k,v in dict_xpaths['text_content'].items()}\n",
    "    数据字典.update({k:get_e_text(v) for k,v in dict_xpaths['text'].items()})\n",
    "    数据字典.update({k:get_e_href(v) for k,v in dict_xpaths['href'].items()})\n",
    "\n",
    "    数据 = pd.DataFrame(数据字典)\n",
    "    #数据.to_excel(\"20春_Web数据挖掘_week03_liepin.xlsx\", sheet_name=\"搜查结果\")\n",
    "    return (数据)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>教育水平</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "      <th>热门公司类型</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>建筑结构工程师</td>\n",
       "      <td>深圳-南山区</td>\n",
       "      <td>天音控股</td>\n",
       "      <td>https://www.liepin.com/job/1926991259.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7954048/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>频道运维岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756245.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>播音主持岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756189.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>后期制作岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927756135.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月25日</td>\n",
       "      <td>摄像记者岗</td>\n",
       "      <td>济南-高新区</td>\n",
       "      <td>中国重型汽车集团有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927755771.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9739005/</td>\n",
       "      <td>中国500强</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>35</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>5-8k·12薪</td>\n",
       "      <td>2020年04月17日</td>\n",
       "      <td>法务专员</td>\n",
       "      <td>沈阳-市府</td>\n",
       "      <td>微贷</td>\n",
       "      <td>https://www.liepin.com/job/1927541985.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8597281/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-20k·13薪</td>\n",
       "      <td>2020年04月16日</td>\n",
       "      <td>运营经理</td>\n",
       "      <td>佛山-顺德区</td>\n",
       "      <td>万和</td>\n",
       "      <td>https://www.liepin.com/job/1926547347.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7862193/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>37</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月15日</td>\n",
       "      <td>数字版权管理运营</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>网易集团</td>\n",
       "      <td>https://www.liepin.com/job/1927471953.shtml</td>\n",
       "      <td>https://www.liepin.com/company/5964833/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>38</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-13k·12薪</td>\n",
       "      <td>2020年04月15日</td>\n",
       "      <td>法务专员(J11102)</td>\n",
       "      <td>杭州</td>\n",
       "      <td>微贷</td>\n",
       "      <td>https://www.liepin.com/job/1927470925.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8597281/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>39</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月15日</td>\n",
       "      <td>税务专员(J11101)</td>\n",
       "      <td>杭州-下城区</td>\n",
       "      <td>微贷</td>\n",
       "      <td>https://www.liepin.com/job/1927470269.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8597281/</td>\n",
       "      <td>上市公司</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>240 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     教育水平     经验          薪水           时间            职称    公司地点          公司名称  \\\n",
       "0   本科及以上  5-10年  20-30k·12薪  2020年04月26日       建筑结构工程师  深圳-南山区          天音控股   \n",
       "1    统招本科   1-3年          面议  2020年04月25日         频道运维岗  济南-高新区  中国重型汽车集团有限公司   \n",
       "2    统招本科   1-3年          面议  2020年04月25日         播音主持岗  济南-高新区  中国重型汽车集团有限公司   \n",
       "3    统招本科   1-3年          面议  2020年04月25日         后期制作岗  济南-高新区  中国重型汽车集团有限公司   \n",
       "4    统招本科   1-3年          面议  2020年04月25日         摄像记者岗  济南-高新区  中国重型汽车集团有限公司   \n",
       "..    ...    ...         ...          ...           ...     ...           ...   \n",
       "35   统招本科   3-5年    5-8k·12薪  2020年04月17日          法务专员   沈阳-市府            微贷   \n",
       "36  本科及以上   3-5年  10-20k·13薪  2020年04月16日          运营经理  佛山-顺德区            万和   \n",
       "37  本科及以上   经验不限          面议  2020年04月15日      数字版权管理运营  广州-天河区          网易集团   \n",
       "38  本科及以上   3-5年  10-13k·12薪  2020年04月15日  法务专员(J11102)      杭州            微贷   \n",
       "39  本科及以上   3-5年          面议  2020年04月15日  税务专员(J11101)  杭州-下城区            微贷   \n",
       "\n",
       "                                             链结  \\\n",
       "0   https://www.liepin.com/job/1926991259.shtml   \n",
       "1   https://www.liepin.com/job/1927756245.shtml   \n",
       "2   https://www.liepin.com/job/1927756189.shtml   \n",
       "3   https://www.liepin.com/job/1927756135.shtml   \n",
       "4   https://www.liepin.com/job/1927755771.shtml   \n",
       "..                                          ...   \n",
       "35  https://www.liepin.com/job/1927541985.shtml   \n",
       "36  https://www.liepin.com/job/1926547347.shtml   \n",
       "37  https://www.liepin.com/job/1927471953.shtml   \n",
       "38  https://www.liepin.com/job/1927470925.shtml   \n",
       "39  https://www.liepin.com/job/1927470269.shtml   \n",
       "\n",
       "                                      公司URL  热门公司类型  \n",
       "0   https://www.liepin.com/company/7954048/  中国500强  \n",
       "1   https://www.liepin.com/company/9739005/  中国500强  \n",
       "2   https://www.liepin.com/company/9739005/  中国500强  \n",
       "3   https://www.liepin.com/company/9739005/  中国500强  \n",
       "4   https://www.liepin.com/company/9739005/  中国500强  \n",
       "..                                      ...     ...  \n",
       "35  https://www.liepin.com/company/8597281/    上市公司  \n",
       "36  https://www.liepin.com/company/7862193/    上市公司  \n",
       "37  https://www.liepin.com/company/5964833/    上市公司  \n",
       "38  https://www.liepin.com/company/8597281/    上市公司  \n",
       "39  https://www.liepin.com/company/8597281/    上市公司  \n",
       "\n",
       "[240 rows x 10 columns]"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "\n",
    "list_df = list()\n",
    "for k,v in 参数_compTag_产品经理.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (热门公司类型 = k)    \n",
    "    list_df.append(df)\n",
    "\n",
    "df_all = pd.concat(list_df)\n",
    "df_all"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_all.to_excel(\"公司_产品经理.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 行业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'互联网/电商': '/zhaopin/?subIndustry=&init=-1&industryType=industry_01&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=040&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '游戏产业': '/zhaopin/?subIndustry=&init=-1&industryType=industry_01&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=420&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '计算机软件': '/zhaopin/?subIndustry=&init=-1&industryType=industry_01&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=010&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " 'IT服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_01&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=030&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '电子/芯片/半导体': '/zhaopin/?subIndustry=&init=-1&industryType=industry_02&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=050&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '通信业': '/zhaopin/?subIndustry=&init=-1&industryType=industry_02&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=060&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '计算机/网络设备': '/zhaopin/?subIndustry=&init=-1&industryType=industry_02&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=020&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '房地产/建筑': '/zhaopin/?subIndustry=&init=-1&industryType=industry_03&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=080&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '规划/设计/装潢': '/zhaopin/?subIndustry=&init=-1&industryType=industry_03&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=100&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '房地产服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_03&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=090&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '银行': '/zhaopin/?subIndustry=&init=-1&industryType=industry_04&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=130&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '保险': '/zhaopin/?subIndustry=&init=-1&industryType=industry_04&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=140&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '基金/证券/投资': '/zhaopin/?subIndustry=&init=-1&industryType=industry_04&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=150&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '会计/审计': '/zhaopin/?subIndustry=&init=-1&industryType=industry_04&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=430&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '信托/担保/拍卖': '/zhaopin/?subIndustry=&init=-1&industryType=industry_04&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=500&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '快消品': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=190&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '批发零售': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=240&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '服装纺织': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=200&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '家具/家电': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=210&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '办公设备': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=220&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '奢侈品/收藏品': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=460&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '珠宝/玩具/工艺品': '/zhaopin/?subIndustry=&init=-1&industryType=industry_05&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=470&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '汽车/摩托车': '/zhaopin/?subIndustry=&init=-1&industryType=industry_06&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=350&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '机械/机电/重工': '/zhaopin/?subIndustry=&init=-1&industryType=industry_06&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=360&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '印刷/包装/造纸': '/zhaopin/?subIndustry=&init=-1&industryType=industry_06&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=180&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '原材料加工': '/zhaopin/?subIndustry=&init=-1&industryType=industry_06&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=370&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '仪器/电气/自动化': '/zhaopin/?subIndustry=&init=-1&industryType=industry_06&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=340&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '制药/生物工程': '/zhaopin/?subIndustry=&init=-1&industryType=industry_10&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=270&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '医疗/保健/美容': '/zhaopin/?subIndustry=&init=-1&industryType=industry_10&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=280&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '医疗器械': '/zhaopin/?subIndustry=&init=-1&industryType=industry_10&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=290&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '能源/水利': '/zhaopin/?subIndustry=&init=-1&industryType=industry_11&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=330&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '石油/化工': '/zhaopin/?subIndustry=&init=-1&industryType=industry_11&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=310&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '采掘/冶炼/矿产': '/zhaopin/?subIndustry=&init=-1&industryType=industry_11&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=320&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '环保': '/zhaopin/?subIndustry=&init=-1&industryType=industry_11&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=300&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '新能源': '/zhaopin/?subIndustry=&init=-1&industryType=industry_11&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=490&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '专业服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=120&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '中介服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=110&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '外包服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=440&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '检测/认证': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=450&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '餐饮/酒旅/服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=230&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '文体娱乐': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=260&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '租赁服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_07&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=510&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '广告/市场/会展': '/zhaopin/?subIndustry=&init=-1&industryType=industry_08&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=070&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '影视文化': '/zhaopin/?subIndustry=&init=-1&industryType=industry_08&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=170&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '教育培训': '/zhaopin/?subIndustry=&init=-1&industryType=industry_08&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=380&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '交通/物流/运输': '/zhaopin/?subIndustry=&init=-1&industryType=industry_09&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=250&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '贸易/进出口': '/zhaopin/?subIndustry=&init=-1&industryType=industry_09&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=160&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '航空/航天': '/zhaopin/?subIndustry=&init=-1&industryType=industry_09&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=480&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '政务/公共服务': '/zhaopin/?subIndustry=&init=-1&industryType=industry_12&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=390&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '农林牧渔': '/zhaopin/?subIndustry=&init=-1&industryType=industry_12&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=410&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '其他行业': '/zhaopin/?subIndustry=&init=-1&industryType=industry_12&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&industries=400&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c'}"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 对行业的数据（链接、文本）抓取\n",
    "行业数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[1] \\\n",
    "                    .xpath('//div[contains(@class,\"sub-industry\")]/a')\n",
    "行业数据选择器链结\n",
    "\n",
    "行业数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 行业数据选择器链结}\n",
    "行业数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 51 entries, 0 to 50\n",
      "Data columns (total 6 columns):\n",
      "scheme      51 non-null object\n",
      "netloc      51 non-null object\n",
      "path        51 non-null object\n",
      "params      51 non-null object\n",
      "query       51 non-null object\n",
      "fragment    51 non-null object\n",
      "dtypes: object(6)\n",
      "memory usage: 2.5+ KB\n",
      "scheme       1\n",
      "netloc       1\n",
      "path         1\n",
      "params       1\n",
      "query       51\n",
      "fragment     1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>subIndustry=&amp;init=-1&amp;industryType=industry_01&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  subIndustry=&init=-1&industryType=industry_01&...           "
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from urllib.parse import urlparse, parse_qs\n",
    "\n",
    "df = pd.DataFrame([ urlparse(x) for x in 行业数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique())\n",
    "df.head(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init              1\n",
      "industryType     12\n",
      "headckid          1\n",
      "flushckid         1\n",
      "fromSearchBtn     1\n",
      "industries       51\n",
      "keyword           1\n",
      "ckid              1\n",
      "siTag             1\n",
      "d_sfrom           1\n",
      "d_ckId            1\n",
      "d_curPage         1\n",
      "d_pageSize        1\n",
      "d_headId          1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>init</th>\n",
       "      <th>industryType</th>\n",
       "      <th>headckid</th>\n",
       "      <th>flushckid</th>\n",
       "      <th>fromSearchBtn</th>\n",
       "      <th>industries</th>\n",
       "      <th>keyword</th>\n",
       "      <th>ckid</th>\n",
       "      <th>siTag</th>\n",
       "      <th>d_sfrom</th>\n",
       "      <th>d_ckId</th>\n",
       "      <th>d_curPage</th>\n",
       "      <th>d_pageSize</th>\n",
       "      <th>d_headId</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>040</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>-1</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>420</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>010</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>-1</td>\n",
       "      <td>industry_01</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>030</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>-1</td>\n",
       "      <td>industry_02</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>050</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  init industryType          headckid flushckid fromSearchBtn industries  \\\n",
       "0   -1  industry_01  3126235f410baf6a         1             2        040   \n",
       "1   -1  industry_01  3126235f410baf6a         1             2        420   \n",
       "2   -1  industry_01  3126235f410baf6a         1             2        010   \n",
       "3   -1  industry_01  3126235f410baf6a         1             2        030   \n",
       "4   -1  industry_02  3126235f410baf6a         1             2        050   \n",
       "\n",
       "  keyword              ckid                                          siTag  \\\n",
       "0    产品经理  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "1    产品经理  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "2    产品经理  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "3    产品经理  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "4    产品经理  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "\n",
       "          d_sfrom                            d_ckId d_curPage d_pageSize  \\\n",
       "0  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "1  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "2  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "3  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "4  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "\n",
       "                           d_headId  \n",
       "0  7377985f13f671459f1bac5712675d4c  \n",
       "1  7377985f13f671459f1bac5712675d4c  \n",
       "2  7377985f13f671459f1bac5712675d4c  \n",
       "3  7377985f13f671459f1bac5712675d4c  \n",
       "4  7377985f13f671459f1bac5712675d4c  "
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 针对query 再解析之 \n",
    "#df_qs = pd.DataFrame([ parse_qs(x) for x in df['query'] ])\n",
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head()\n",
    "# df_qs[['keyword','industries']]  取表格中特定的某个值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['040'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}\n",
      "{'互联网/电商': '040', '游戏产业': '420', '计算机软件': '010', 'IT服务': '030', '电子/芯片/半导体': '050', '通信业': '060', '计算机/网络设备': '020', '房地产/建筑': '080', '规划/设计/装潢': '100', '房地产服务': '090', '银行': '130', '保险': '140', '基金/证券/投资': '150', '会计/审计': '430', '信托/担保/拍卖': '500', '快消品': '190', '批发零售': '240', '服装纺织': '200', '家具/家电': '210', '办公设备': '220', '奢侈品/收藏品': '460', '珠宝/玩具/工艺品': '470', '汽车/摩托车': '350', '机械/机电/重工': '360', '印刷/包装/造纸': '180', '原材料加工': '370', '仪器/电气/自动化': '340', '制药/生物工程': '270', '医疗/保健/美容': '280', '医疗器械': '290', '能源/水利': '330', '石油/化工': '310', '采掘/冶炼/矿产': '320', '环保': '300', '新能源': '490', '专业服务': '120', '中介服务': '110', '外包服务': '440', '检测/认证': '450', '餐饮/酒旅/服务': '230', '文体娱乐': '260', '租赁服务': '510', '广告/市场/会展': '070', '影视文化': '170', '教育培训': '380', '交通/物流/运输': '250', '贸易/进出口': '160', '航空/航天': '480', '政务/公共服务': '390', '农林牧渔': '410', '其他行业': '400'}\n"
     ]
    }
   ],
   "source": [
    "# 建构 参数模板 及 字典_industries\n",
    "def parse_url_qs_for_industries (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "# parse_url_qs_for_compTag(list(公司数据选择器链结.values())[0])['compTag']\n",
    "参数模板 = parse_url_qs_for_industries(list(行业数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "# [ parse_url_qs_for_compTag(x)['compTag'] for x in 公司数据选择器链结.values()]\n",
    "[ parse_url_qs_for_industries(x)['industries'][0] for x in 行业数据选择器链结.values()]\n",
    "\n",
    "字典_industries = { k:parse_url_qs_for_industries(v)['industries'][0] for k,v in 行业数据选择器链结.items()}\n",
    "print (字典_industries)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'互联网/电商': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['040'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '游戏产业': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['420'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '计算机软件': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['010'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, 'IT服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['030'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '电子/芯片/半导体': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['050'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '通信业': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['060'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '计算机/网络设备': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['020'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '房地产/建筑': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['080'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '规划/设计/装潢': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['100'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '房地产服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['090'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '银行': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['130'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '保险': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['140'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '基金/证券/投资': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['150'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '会计/审计': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['430'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '信托/担保/拍卖': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['500'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '快消品': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['190'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '批发零售': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['240'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '服装纺织': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['200'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '家具/家电': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['210'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '办公设备': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['220'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '奢侈品/收藏品': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['460'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '珠宝/玩具/工艺品': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['470'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '汽车/摩托车': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['350'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '机械/机电/重工': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['360'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '印刷/包装/造纸': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['180'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '原材料加工': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['370'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '仪器/电气/自动化': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['340'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '制药/生物工程': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['270'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '医疗/保健/美容': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['280'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '医疗器械': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['290'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '能源/水利': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['330'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '石油/化工': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['310'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '采掘/冶炼/矿产': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['320'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '环保': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['300'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '新能源': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['490'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '专业服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['120'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '中介服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['110'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '外包服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['440'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '检测/认证': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['450'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '餐饮/酒旅/服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['230'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '文体娱乐': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['260'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '租赁服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['510'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '广告/市场/会展': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['070'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '影视文化': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['170'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '教育培训': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['380'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '交通/物流/运输': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['250'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '贸易/进出口': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['160'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '航空/航天': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['480'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '政务/公共服务': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['390'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '农林牧渔': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['410'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '其他行业': {'init': ['-1'], 'industryType': ['industry_01'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'industries': ['400'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}}"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n"
     ]
    }
   ],
   "source": [
    "def 参数模板生成(industries , keyword ):\n",
    "    参数 = 参数模板.copy()\n",
    "    参数['industries'] = industries\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "参数_industries_产品经理 = { k:参数模板生成(industries = [v], keyword = ['产品经理']) for k,v in 字典_industries.items()}\n",
    "print(参数_industries_产品经理)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>教育水平</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "      <th>行业分类</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>学历不限</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>10-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>直播媒介</td>\n",
       "      <td>北京</td>\n",
       "      <td>钱方好近</td>\n",
       "      <td>https://www.liepin.com/job/1927781015.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7863496/</td>\n",
       "      <td>互联网/电商</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>国际销售（J10390)</td>\n",
       "      <td>上海-浦东新区</td>\n",
       "      <td>西域供应链</td>\n",
       "      <td>https://www.liepin.com/job/1927779263.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8396469/</td>\n",
       "      <td>互联网/电商</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>15-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>独立站站长</td>\n",
       "      <td>杭州-西溪</td>\n",
       "      <td>新兔科技</td>\n",
       "      <td>https://www.liepin.com/job/1927778439.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10100579/</td>\n",
       "      <td>互联网/电商</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>50-80k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>产品总监</td>\n",
       "      <td></td>\n",
       "      <td>敦煌网</td>\n",
       "      <td>https://www.liepin.com/job/1927774223.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7862497/</td>\n",
       "      <td>互联网/电商</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>12-18k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>南通城市经理</td>\n",
       "      <td>南通-崇川区</td>\n",
       "      <td>爱回收</td>\n",
       "      <td>https://www.liepin.com/job/1927773439.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7868039/</td>\n",
       "      <td>互联网/电商</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>35</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>10-14k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>财务经理 (257)</td>\n",
       "      <td>深圳-宝安区</td>\n",
       "      <td>深圳市大世界信息技术有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927782083.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9878113/</td>\n",
       "      <td>其他行业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>部门经理（采购管理部）</td>\n",
       "      <td>济南</td>\n",
       "      <td>中税(济南)财务服务有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927782067.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12219957/</td>\n",
       "      <td>其他行业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>37</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>成本合约部部门经理</td>\n",
       "      <td>济南</td>\n",
       "      <td>中税(济南)财务服务有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927781795.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12219957/</td>\n",
       "      <td>其他行业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>38</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>经验不限</td>\n",
       "      <td>2-4k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>人力资源实习生（员工关系）</td>\n",
       "      <td></td>\n",
       "      <td>银河互联网</td>\n",
       "      <td>https://www.liepin.com/job/1927781733.shtml</td>\n",
       "      <td>https://www.liepin.com/company/3446189/</td>\n",
       "      <td>其他行业</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>39</td>\n",
       "      <td>统招本科</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>20-30k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>部门经理（财务资金部）</td>\n",
       "      <td>济南</td>\n",
       "      <td>中税(济南)财务服务有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927781625.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12219957/</td>\n",
       "      <td>其他行业</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>2040 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     教育水平     经验          薪水           时间             职称     公司地点  \\\n",
       "0    学历不限   经验不限  10-30k·12薪  2020年04月26日           直播媒介       北京   \n",
       "1   本科及以上   1-3年          面议  2020年04月26日   国际销售（J10390)  上海-浦东新区   \n",
       "2   本科及以上  5-10年  15-30k·12薪  2020年04月26日          独立站站长    杭州-西溪   \n",
       "3   本科及以上  5-10年  50-80k·12薪  2020年04月26日           产品总监            \n",
       "4   本科及以上   3-5年  12-18k·12薪  2020年04月26日         南通城市经理   南通-崇川区   \n",
       "..    ...    ...         ...          ...            ...      ...   \n",
       "35  大专及以上   3-5年  10-14k·12薪  2020年04月26日     财务经理 (257)   深圳-宝安区   \n",
       "36  本科及以上  5-10年  20-30k·12薪  2020年04月26日    部门经理（采购管理部）       济南   \n",
       "37  本科及以上  5-10年  20-30k·12薪  2020年04月26日      成本合约部部门经理       济南   \n",
       "38   统招本科   经验不限    2-4k·12薪  2020年04月26日  人力资源实习生（员工关系）            \n",
       "39   统招本科  5-10年  20-30k·12薪  2020年04月26日    部门经理（财务资金部）       济南   \n",
       "\n",
       "              公司名称                                           链结  \\\n",
       "0             钱方好近  https://www.liepin.com/job/1927781015.shtml   \n",
       "1            西域供应链  https://www.liepin.com/job/1927779263.shtml   \n",
       "2             新兔科技  https://www.liepin.com/job/1927778439.shtml   \n",
       "3              敦煌网  https://www.liepin.com/job/1927774223.shtml   \n",
       "4              爱回收  https://www.liepin.com/job/1927773439.shtml   \n",
       "..             ...                                          ...   \n",
       "35  深圳市大世界信息技术有限公司  https://www.liepin.com/job/1927782083.shtml   \n",
       "36  中税(济南)财务服务有限公司  https://www.liepin.com/job/1927782067.shtml   \n",
       "37  中税(济南)财务服务有限公司  https://www.liepin.com/job/1927781795.shtml   \n",
       "38           银河互联网  https://www.liepin.com/job/1927781733.shtml   \n",
       "39  中税(济南)财务服务有限公司  https://www.liepin.com/job/1927781625.shtml   \n",
       "\n",
       "                                       公司URL    行业分类  \n",
       "0    https://www.liepin.com/company/7863496/  互联网/电商  \n",
       "1    https://www.liepin.com/company/8396469/  互联网/电商  \n",
       "2   https://www.liepin.com/company/10100579/  互联网/电商  \n",
       "3    https://www.liepin.com/company/7862497/  互联网/电商  \n",
       "4    https://www.liepin.com/company/7868039/  互联网/电商  \n",
       "..                                       ...     ...  \n",
       "35   https://www.liepin.com/company/9878113/    其他行业  \n",
       "36  https://www.liepin.com/company/12219957/    其他行业  \n",
       "37  https://www.liepin.com/company/12219957/    其他行业  \n",
       "38   https://www.liepin.com/company/3446189/    其他行业  \n",
       "39  https://www.liepin.com/company/12219957/    其他行业  \n",
       "\n",
       "[2040 rows x 10 columns]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_df1 = list()\n",
    "for k,v in 参数_industries_产品经理.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (行业分类 = k)    \n",
    "    list_df1.append(df)\n",
    "\n",
    "df_all1 = pd.concat(list_df1)\n",
    "df_all1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_all1.to_excel(\"行业_产品经理.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 薪资"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'10-15万': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=10$15&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '15-20万': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=15$20&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '20-30万': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=20$30&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '30-50万': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=30$50&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '50-100万': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=50$100&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c',\n",
       " '100万以上': '/zhaopin/?init=-1&headckid=3126235f410baf6a&flushckid=1&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&salary=100$999&ckid=3126235f410baf6a&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c'}"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "薪资数据选择器链结 = r.html.xpath('//div[@data-selector=\"search-conditions\"]')[0] \\\n",
    "                    .xpath('//dt[@class=\"search-title\"]/following-sibling::dd')[3] \\\n",
    "                    .xpath('//dd[contains(@data-param,\"salary\")]/a')\n",
    "薪资数据选择器链结\n",
    "\n",
    "薪资数据选择器链结 = { x.xpath(\"a/text()\")[0]:x.xpath(\"a/@href\")[0] for x in 薪资数据选择器链结}\n",
    "薪资数据选择器链结"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 6 entries, 0 to 5\n",
      "Data columns (total 6 columns):\n",
      "scheme      6 non-null object\n",
      "netloc      6 non-null object\n",
      "path        6 non-null object\n",
      "params      6 non-null object\n",
      "query       6 non-null object\n",
      "fragment    6 non-null object\n",
      "dtypes: object(6)\n",
      "memory usage: 416.0+ bytes\n",
      "scheme      1\n",
      "netloc      1\n",
      "path        1\n",
      "params      1\n",
      "query       6\n",
      "fragment    1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;flushckid=1&amp;...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "1                /zhaopin/          \n",
       "2                /zhaopin/          \n",
       "3                /zhaopin/          \n",
       "4                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "1  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "2  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "3  init=-1&headckid=3126235f410baf6a&flushckid=1&...           \n",
       "4  init=-1&headckid=3126235f410baf6a&flushckid=1&...           "
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 解析url\n",
    "from urllib.parse import urlparse, parse_qs\n",
    "\n",
    "df = pd.DataFrame([ urlparse(x) for x in 薪资数据选择器链结.values()])\n",
    "df.info()\n",
    "print(df.nunique())\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init             1\n",
      "headckid         1\n",
      "flushckid        1\n",
      "fromSearchBtn    1\n",
      "keyword          1\n",
      "salary           6\n",
      "ckid             1\n",
      "siTag            1\n",
      "d_sfrom          1\n",
      "d_ckId           1\n",
      "d_curPage        1\n",
      "d_pageSize       1\n",
      "d_headId         1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>init</th>\n",
       "      <th>headckid</th>\n",
       "      <th>flushckid</th>\n",
       "      <th>fromSearchBtn</th>\n",
       "      <th>keyword</th>\n",
       "      <th>salary</th>\n",
       "      <th>ckid</th>\n",
       "      <th>siTag</th>\n",
       "      <th>d_sfrom</th>\n",
       "      <th>d_ckId</th>\n",
       "      <th>d_curPage</th>\n",
       "      <th>d_pageSize</th>\n",
       "      <th>d_headId</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>10$15</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>15$20</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>20$30</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>30$50</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>50$100</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>100$999</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  init          headckid flushckid fromSearchBtn keyword   salary  \\\n",
       "0   -1  3126235f410baf6a         1             2    产品经理    10$15   \n",
       "1   -1  3126235f410baf6a         1             2    产品经理    15$20   \n",
       "2   -1  3126235f410baf6a         1             2    产品经理    20$30   \n",
       "3   -1  3126235f410baf6a         1             2    产品经理    30$50   \n",
       "4   -1  3126235f410baf6a         1             2    产品经理   50$100   \n",
       "5   -1  3126235f410baf6a         1             2    产品经理  100$999   \n",
       "\n",
       "               ckid                                          siTag  \\\n",
       "0  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "1  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "2  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "3  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "4  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "5  3126235f410baf6a  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw   \n",
       "\n",
       "          d_sfrom                            d_ckId d_curPage d_pageSize  \\\n",
       "0  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "1  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "2  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "3  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "4  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "5  search_unknown  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "\n",
       "                           d_headId  \n",
       "0  7377985f13f671459f1bac5712675d4c  \n",
       "1  7377985f13f671459f1bac5712675d4c  \n",
       "2  7377985f13f671459f1bac5712675d4c  \n",
       "3  7377985f13f671459f1bac5712675d4c  \n",
       "4  7377985f13f671459f1bac5712675d4c  \n",
       "5  7377985f13f671459f1bac5712675d4c  "
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# B-3 针对query 再解析之 \n",
    "#df_qs = pd.DataFrame([ parse_qs(x) for x in df['query'] ])\n",
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "print (df_qs.nunique())\n",
    "df_qs.head(12)\n",
    "# df_qs[['keyword','industries']]  取表格中特定的某个值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['10$15'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}\n",
      "{'10-15万': '10$15', '15-20万': '15$20', '20-30万': '20$30', '30-50万': '30$50', '50-100万': '50$100', '100万以上': '100$999'}\n"
     ]
    }
   ],
   "source": [
    "# 建构 参数模板 及 字典_salary\n",
    "def parse_url_qs_for_salary (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "# parse_url_qs_for_compTag(list(公司数据选择器链结.values())[0])['compTag']\n",
    "参数模板 = parse_url_qs_for_salary(list(薪资数据选择器链结.values())[0])\n",
    "print(参数模板)\n",
    "# [ parse_url_qs_for_compTag(x)['compTag'] for x in 公司数据选择器链结.values()]\n",
    "[ parse_url_qs_for_salary(x)['salary'][0] for x in 薪资数据选择器链结.values()]\n",
    "\n",
    "字典_salary = { k:parse_url_qs_for_salary(v)['salary'][0] for k,v in 薪资数据选择器链结.items()}\n",
    "print(字典_salary)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'10-15万': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['10$15'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '15-20万': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['15$20'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '20-30万': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['20$30'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '30-50万': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['30$50'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '50-100万': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['50$100'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}, '100万以上': {'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'flushckid': ['1'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'salary': ['100$999'], 'ckid': ['3126235f410baf6a'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c']}}\n"
     ]
    }
   ],
   "source": [
    "# 生成城市参数模板  \n",
    "def 参数模板生成(salary , keyword ):\n",
    "    参数 = 参数模板.copy()  # 复制一份参数模版\n",
    "    参数['salary'] = salary\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "# 赋值：keyword\n",
    "参数_salary_产品经理 = { k:参数模板生成(salary = [v], keyword = ['产品经理']) for k,v in 字典_salary.items()}\n",
    "print(参数_salary_产品经理)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>教育水平</th>\n",
       "      <th>经验</th>\n",
       "      <th>薪水</th>\n",
       "      <th>时间</th>\n",
       "      <th>职称</th>\n",
       "      <th>公司地点</th>\n",
       "      <th>公司名称</th>\n",
       "      <th>链结</th>\n",
       "      <th>公司URL</th>\n",
       "      <th>薪资水平</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>区域销售经理</td>\n",
       "      <td>上海</td>\n",
       "      <td>上海迪罗电气有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927784195.shtml</td>\n",
       "      <td>https://www.liepin.com/company/7927458/</td>\n",
       "      <td>10-15万</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>5-10年</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>工业设计总监</td>\n",
       "      <td>佛山-顺德区</td>\n",
       "      <td>东方麦田</td>\n",
       "      <td>https://www.liepin.com/job/1927782651.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8353351/</td>\n",
       "      <td>10-15万</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>6-10k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>初中语文教师</td>\n",
       "      <td>常州</td>\n",
       "      <td>常州市昂立教育培训中心</td>\n",
       "      <td>https://www.liepin.com/job/1927782409.shtml</td>\n",
       "      <td>https://www.liepin.com/company/10090569/</td>\n",
       "      <td>10-15万</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>1-3年</td>\n",
       "      <td>5-7k·14薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>实验室QA</td>\n",
       "      <td>杭州-江干区</td>\n",
       "      <td>杭康药业</td>\n",
       "      <td>https://www.liepin.com/job/1927782315.shtml</td>\n",
       "      <td>https://www.liepin.com/company/8247321/</td>\n",
       "      <td>10-15万</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>3-5年</td>\n",
       "      <td>8-15k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>PMC主管/经理（电商）</td>\n",
       "      <td>广州-天河区</td>\n",
       "      <td>广州麦匠信息科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927781753.shtml</td>\n",
       "      <td>https://www.liepin.com/company/9356817/</td>\n",
       "      <td>10-15万</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>35</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>10年以上</td>\n",
       "      <td>30-50k·20薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>计量检测总经理</td>\n",
       "      <td>成都-龙潭</td>\n",
       "      <td>安东石油技术(集团)有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927776329.shtml</td>\n",
       "      <td>https://www.liepin.com/company/886971/</td>\n",
       "      <td>100万以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>36</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>10年以上</td>\n",
       "      <td>45-70k·15薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>组织发展(OD)</td>\n",
       "      <td></td>\n",
       "      <td>宜信公司</td>\n",
       "      <td>https://www.liepin.com/job/1927775325.shtml</td>\n",
       "      <td>https://www.liepin.com/company/891743/</td>\n",
       "      <td>100万以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>37</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>10年以上</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>总经理</td>\n",
       "      <td>济南</td>\n",
       "      <td>中税(济南)财务服务有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927775279.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12219957/</td>\n",
       "      <td>100万以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>38</td>\n",
       "      <td>本科及以上</td>\n",
       "      <td>10年以上</td>\n",
       "      <td>面议</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>集团资金高管</td>\n",
       "      <td></td>\n",
       "      <td>泰禾集团股份有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927775115.shtml</td>\n",
       "      <td>https://www.liepin.com/company/6629475/</td>\n",
       "      <td>100万以上</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>39</td>\n",
       "      <td>大专及以上</td>\n",
       "      <td>一年以下</td>\n",
       "      <td>100-200k·12薪</td>\n",
       "      <td>2020年04月26日</td>\n",
       "      <td>区域销售总监</td>\n",
       "      <td>日照</td>\n",
       "      <td>聊城巨友网络科技有限公司</td>\n",
       "      <td>https://www.liepin.com/job/1927774911.shtml</td>\n",
       "      <td>https://www.liepin.com/company/12222917/</td>\n",
       "      <td>100万以上</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>240 rows × 10 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     教育水平     经验            薪水           时间            职称    公司地点  \\\n",
       "0   大专及以上  5-10年            面议  2020年04月26日        区域销售经理      上海   \n",
       "1   大专及以上  5-10年            面议  2020年04月26日        工业设计总监  佛山-顺德区   \n",
       "2   本科及以上   3-5年     6-10k·12薪  2020年04月26日        初中语文教师      常州   \n",
       "3   大专及以上   1-3年      5-7k·14薪  2020年04月26日         实验室QA  杭州-江干区   \n",
       "4   大专及以上   3-5年     8-15k·12薪  2020年04月26日  PMC主管/经理（电商）  广州-天河区   \n",
       "..    ...    ...           ...          ...           ...     ...   \n",
       "35  本科及以上  10年以上    30-50k·20薪  2020年04月26日       计量检测总经理   成都-龙潭   \n",
       "36  本科及以上  10年以上    45-70k·15薪  2020年04月26日      组织发展(OD)           \n",
       "37  本科及以上  10年以上            面议  2020年04月26日           总经理      济南   \n",
       "38  本科及以上  10年以上            面议  2020年04月26日        集团资金高管           \n",
       "39  大专及以上   一年以下  100-200k·12薪  2020年04月26日        区域销售总监      日照   \n",
       "\n",
       "              公司名称                                           链结  \\\n",
       "0       上海迪罗电气有限公司  https://www.liepin.com/job/1927784195.shtml   \n",
       "1             东方麦田  https://www.liepin.com/job/1927782651.shtml   \n",
       "2      常州市昂立教育培训中心  https://www.liepin.com/job/1927782409.shtml   \n",
       "3             杭康药业  https://www.liepin.com/job/1927782315.shtml   \n",
       "4     广州麦匠信息科技有限公司  https://www.liepin.com/job/1927781753.shtml   \n",
       "..             ...                                          ...   \n",
       "35  安东石油技术(集团)有限公司  https://www.liepin.com/job/1927776329.shtml   \n",
       "36            宜信公司  https://www.liepin.com/job/1927775325.shtml   \n",
       "37  中税(济南)财务服务有限公司  https://www.liepin.com/job/1927775279.shtml   \n",
       "38      泰禾集团股份有限公司  https://www.liepin.com/job/1927775115.shtml   \n",
       "39    聊城巨友网络科技有限公司  https://www.liepin.com/job/1927774911.shtml   \n",
       "\n",
       "                                       公司URL    薪资水平  \n",
       "0    https://www.liepin.com/company/7927458/  10-15万  \n",
       "1    https://www.liepin.com/company/8353351/  10-15万  \n",
       "2   https://www.liepin.com/company/10090569/  10-15万  \n",
       "3    https://www.liepin.com/company/8247321/  10-15万  \n",
       "4    https://www.liepin.com/company/9356817/  10-15万  \n",
       "..                                       ...     ...  \n",
       "35    https://www.liepin.com/company/886971/  100万以上  \n",
       "36    https://www.liepin.com/company/891743/  100万以上  \n",
       "37  https://www.liepin.com/company/12219957/  100万以上  \n",
       "38   https://www.liepin.com/company/6629475/  100万以上  \n",
       "39  https://www.liepin.com/company/12222917/  100万以上  \n",
       "\n",
       "[240 rows x 10 columns]"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "list_df2 = list()\n",
    "for k,v in 参数_salary_产品经理.items():\n",
    "    payload = v\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    df = df.assign (薪资水平 = k)    \n",
    "    list_df2.append(df)\n",
    "\n",
    "df_all2 = pd.concat(list_df2)\n",
    "df_all2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_all.to_excel(\"薪资_产品经理.xlsx\", sheet_name=\"搜查结果\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 翻页"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[<Element 'a' href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1'>, <Element 'a' href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=2'>, <Element 'a' href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=3'>, <Element 'a' href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=4'>, <Element 'a' href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1'>, <Element 'a' class=('last',) href='/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=9' title='末页'>]\n",
      "{'2': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1', '3': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=2', '4': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=3', '5': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=4', '下一页': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1', '': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=9'}\n"
     ]
    }
   ],
   "source": [
    "# A-1  xpath 解析翻页a/@href\n",
    "xpath_翻页a = '//div[@class=\"pagerbar\"]/a' # 有disabled, current等href是javascript\n",
    "xpath_翻页a = '//div[@class=\"pagerbar\"]/a[starts-with(@href,\"/zhaopin\")]'\n",
    "print (r.html.xpath(xpath_翻页a)) # 物件\n",
    "\n",
    "href_列表 = [x.xpath('//@href')[0] for x in r.html.xpath(xpath_翻页a)]\n",
    "#print (href_列表)\n",
    "\n",
    "文字_列表 = [x.text for x in r.html.xpath(xpath_翻页a)]\n",
    "#print (文字_列表)\n",
    "\n",
    "href_字典 = {x.text:x.xpath('//@href')[0]  for x in r.html.xpath(xpath_翻页a)}\n",
    "print (href_字典)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>scheme</th>\n",
       "      <th>netloc</th>\n",
       "      <th>path</th>\n",
       "      <th>params</th>\n",
       "      <th>query</th>\n",
       "      <th>fragment</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td></td>\n",
       "      <td></td>\n",
       "      <td>/zhaopin/</td>\n",
       "      <td></td>\n",
       "      <td>init=-1&amp;headckid=3126235f410baf6a&amp;fromSearchBt...</td>\n",
       "      <td></td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  scheme netloc       path params  \\\n",
       "0                /zhaopin/          \n",
       "1                /zhaopin/          \n",
       "2                /zhaopin/          \n",
       "3                /zhaopin/          \n",
       "4                /zhaopin/          \n",
       "5                /zhaopin/          \n",
       "\n",
       "                                               query fragment  \n",
       "0  init=-1&headckid=3126235f410baf6a&fromSearchBt...           \n",
       "1  init=-1&headckid=3126235f410baf6a&fromSearchBt...           \n",
       "2  init=-1&headckid=3126235f410baf6a&fromSearchBt...           \n",
       "3  init=-1&headckid=3126235f410baf6a&fromSearchBt...           \n",
       "4  init=-1&headckid=3126235f410baf6a&fromSearchBt...           \n",
       "5  init=-1&headckid=3126235f410baf6a&fromSearchBt...           "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "scheme      1\n",
      "netloc      1\n",
      "path        1\n",
      "params      1\n",
      "query       5\n",
      "fragment    1\n",
      "dtype: int64\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>init</th>\n",
       "      <th>headckid</th>\n",
       "      <th>fromSearchBtn</th>\n",
       "      <th>keyword</th>\n",
       "      <th>ckid</th>\n",
       "      <th>siTag</th>\n",
       "      <th>d_sfrom</th>\n",
       "      <th>d_ckId</th>\n",
       "      <th>d_curPage</th>\n",
       "      <th>d_pageSize</th>\n",
       "      <th>d_headId</th>\n",
       "      <th>curPage</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <td>0</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>1</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>2</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>3</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>4</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <td>5</td>\n",
       "      <td>-1</td>\n",
       "      <td>3126235f410baf6a</td>\n",
       "      <td>2</td>\n",
       "      <td>产品经理</td>\n",
       "      <td>3126235f410baf6a°radeFlag=0</td>\n",
       "      <td>1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw</td>\n",
       "      <td>search_unknown</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>0</td>\n",
       "      <td>40</td>\n",
       "      <td>7377985f13f671459f1bac5712675d4c</td>\n",
       "      <td>9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "  init          headckid fromSearchBtn keyword                         ckid  \\\n",
       "0   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "1   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "2   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "3   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "4   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "5   -1  3126235f410baf6a             2    产品经理  3126235f410baf6a°radeFlag=0   \n",
       "\n",
       "                                           siTag         d_sfrom  \\\n",
       "0  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "1  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "2  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "3  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "4  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "5  1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw  search_unknown   \n",
       "\n",
       "                             d_ckId d_curPage d_pageSize  \\\n",
       "0  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "1  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "2  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "3  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "4  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "5  7377985f13f671459f1bac5712675d4c         0         40   \n",
       "\n",
       "                           d_headId curPage  \n",
       "0  7377985f13f671459f1bac5712675d4c       1  \n",
       "1  7377985f13f671459f1bac5712675d4c       2  \n",
       "2  7377985f13f671459f1bac5712675d4c       3  \n",
       "3  7377985f13f671459f1bac5712675d4c       4  \n",
       "4  7377985f13f671459f1bac5712675d4c       1  \n",
       "5  7377985f13f671459f1bac5712675d4c       9  "
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "init             1\n",
      "headckid         1\n",
      "fromSearchBtn    1\n",
      "keyword          1\n",
      "ckid             1\n",
      "siTag            1\n",
      "d_sfrom          1\n",
      "d_ckId           1\n",
      "d_curPage        1\n",
      "d_pageSize       1\n",
      "d_headId         1\n",
      "curPage          5\n",
      "dtype: int64\n"
     ]
    }
   ],
   "source": [
    "# A-2 建构参数模板：找到关键参数及参数结构\n",
    "\n",
    "# 需要模组库\n",
    "from urllib.parse import urlparse, parse_qs\n",
    "import pandas as pd\n",
    "from IPython.display import display, HTML\n",
    "\n",
    "# 总体目标：输入 href_列表, 建构出参数字典\n",
    "\n",
    "# urlparse 解析后丢入数据框\n",
    "df = pd.DataFrame([ urlparse(x) for x in href_列表])\n",
    "df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "\n",
    "display(df)\n",
    "print(df.nunique())\n",
    "display(df_qs)\n",
    "print(df_qs.nunique())\n",
    "\n",
    "df_qs.curPage\n",
    "df_qs = df_qs.assign (curPage_int=df_qs.curPage.astype(int)) # 变成整数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'init': ['-1'], 'headckid': ['3126235f410baf6a'], 'fromSearchBtn': ['2'], 'keyword': ['产品经理'], 'ckid': ['3126235f410baf6a°radeFlag=0'], 'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'], 'd_sfrom': ['search_unknown'], 'd_ckId': ['7377985f13f671459f1bac5712675d4c'], 'd_curPage': ['0'], 'd_pageSize': ['40'], 'd_headId': ['7377985f13f671459f1bac5712675d4c'], 'curPage': ['1']}\n",
      "{'2': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1', '3': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=2', '4': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=3', '5': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=4', '下一页': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=1', '': '/zhaopin/?init=-1&headckid=3126235f410baf6a&fromSearchBtn=2&keyword=%E4%BA%A7%E5%93%81%E7%BB%8F%E7%90%86&ckid=3126235f410baf6a°radeFlag=0&siTag=1B2M2Y8AsgTpgAmY7PhCfg%7EfA9rXquZc5IkJpXC-Ycixw&d_sfrom=search_unknown&d_ckId=7377985f13f671459f1bac5712675d4c&d_curPage=0&d_pageSize=40&d_headId=7377985f13f671459f1bac5712675d4c&curPage=9'}\n"
     ]
    }
   ],
   "source": [
    "def parse_url_qs_for_curPage (url):\n",
    "    six_parts = urlparse(url) \n",
    "    out = parse_qs(six_parts.query)\n",
    "    return (out)\n",
    "\n",
    "# 取一例做模板\n",
    "参数模板 = parse_url_qs_for_curPage(href_列表[0])\n",
    "print (参数模板)\n",
    "\n",
    "print (href_字典)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1\n",
      "9\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{0: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [0]},\n",
       " 1: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [1]},\n",
       " 2: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [2]},\n",
       " 3: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [3]},\n",
       " 4: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [4]},\n",
       " 5: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [5]},\n",
       " 6: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [6]},\n",
       " 7: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [7]},\n",
       " 8: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [8]},\n",
       " 9: {'init': ['-1'],\n",
       "  'headckid': ['3126235f410baf6a'],\n",
       "  'fromSearchBtn': ['2'],\n",
       "  'keyword': ['产品经理'],\n",
       "  'ckid': ['3126235f410baf6a°radeFlag=0'],\n",
       "  'siTag': ['1B2M2Y8AsgTpgAmY7PhCfg~fA9rXquZc5IkJpXC-Ycixw'],\n",
       "  'd_sfrom': ['search_unknown'],\n",
       "  'd_ckId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'd_curPage': ['0'],\n",
       "  'd_pageSize': ['40'],\n",
       "  'd_headId': ['7377985f13f671459f1bac5712675d4c'],\n",
       "  'curPage': [9]}}"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def 参数模板生成(keyword, curPage):\n",
    "    参数 = 参数模板.copy()\n",
    "    参数['curPage'] = curPage\n",
    "    参数['keyword'] = keyword\n",
    "    return (参数)\n",
    "\n",
    "参数_keyword_产品经理_curPage = { \n",
    "    i:参数模板生成(curPage = [i], \\\n",
    "                  keyword = ['产品经理']) \\\n",
    "    for i,v in href_字典.items()\\\n",
    "    }\n",
    "\n",
    "# print(参数_keyword_用户体验_curPage) # 只生成本页有的额外翻页URL, 并没有推估到&curPage=9,也没有这页\n",
    "\n",
    "print (df_qs.curPage_int.min()) # 最小值只有1\n",
    "print (df_qs.curPage_int.max()) # 最大值只有9\n",
    "\n",
    "# 应该是 0 (本页)....9(最大值)\n",
    "\n",
    "参数_keyword_产品经理_curPage = { \n",
    "    i:参数模板生成(curPage = [i], \\\n",
    "                  keyword = ['产品经理']) \\\n",
    "    for i in range(0,df_qs.curPage_int.max()+1)\\\n",
    "    }\n",
    "参数_keyword_产品经理_curPage"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "产品经理 10\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#%%time\n",
    "# B-3 多个页面+多个关键词\n",
    "import time\n",
    "from random import random\n",
    "\n",
    "url = \"https://www.liepin.com/zhaopin/\"\n",
    "xpath_翻页a = '//div[@class=\"pagerbar\"]/a[starts-with(@href,\"/zhaopin\")]'\n",
    "\n",
    "keywords = ['产品经理']\n",
    "list_df3 = list()\n",
    "\n",
    "## 第一页试探有多长的页面\n",
    "for key in keywords:\n",
    "    payload = 参数模板生成(keyword=[key], curPage=['0'])\n",
    "    df = requests_liepin( url, params = payload)\n",
    "    href_列表 = [x.xpath('//@href')[0] for x in r.html.xpath(xpath_翻页a)]\n",
    "    df = pd.DataFrame([ urlparse(x) for x in href_列表])\n",
    "    df_qs = pd.DataFrame([{k:v[0] for k,v in parse_qs(x).items()} for x in df['query'] ])\n",
    "    df_qs = df_qs.assign (curPage_int=df_qs.curPage.astype(int)) # 变成整数\n",
    "    长度 = df_qs.curPage_int.max()+1\n",
    "    参数_keyword_X_curPage = { \n",
    "        i:参数模板生成(curPage = [i], \\\n",
    "                      keyword = [key]) \\\n",
    "        for i in range(0,长度)\\\n",
    "        }\n",
    "    #print (参数_keyword_X_curPage)\n",
    "    print (key,长度)\n",
    "    \n",
    "    for k,v in 参数_keyword_X_curPage.items():\n",
    "        payload = v\n",
    "        df = requests_liepin( url, params = payload)\n",
    "        time.sleep(3+4*random())  #放慢脚步 3-7秒, 平均约5秒\n",
    "        df = df.assign (keyword = key)  # 区分  keyword    \n",
    "        df = df.assign (curPage = k)  # 区分  curPage    \n",
    "        list_df3.append(df)\n",
    "        \n",
    "df_all3 = pd.concat(list_df3).reset_index()\n",
    "df_all3.index.name = '序'\n",
    "\n",
    "df_all3.to_excel(\"产品经理_翻页数据.xlsx\",\\\n",
    "                sheet_name=\"_\".join(keywords))\n",
    "# 预估时间: 2*5秒*10 =100\n",
    "# 预估数量: 2*40*10 =800"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
